<template>
    <a-dropdown >
        <a-icon type="ellipsis" :rotate="90" />
        <a-menu slot="overlay">
            <a-menu-item @click="addFun(item)" v-show="addShow">
                <span><a-icon type="plus-circle" /></span>
                <span>新增</span>

            </a-menu-item>
            <a-menu-item @click="editFun(item)" v-show="editShow">
                <span><a-icon type="edit" /></span>
                <span>修改</span>

            </a-menu-item>
            <a-menu-item @click="copyFun(item)" v-show="copyShow">
                <span><a-icon type="copy" /></span>
                <span>复制</span>

            </a-menu-item>
            <a-menu-item @click="delFun(item)" v-show="delShow">
                <span><a-icon type="delete" /></span>
                <span>删除</span>

            </a-menu-item>
        </a-menu>
    </a-dropdown>
</template>

<script>
export default {
    props: ["item","delShow","copyShow","editShow","addShow"],
    data() {
        return {
            
        };
    },
    methods: {
        //新增项
        addFun() {
            this.$emit("add");
        },
        //复制项
        copyFun(item){
            this.$emit("copy",item);
        },
        //修改项
        editFun(item) {
            this.$emit("edit", item);
        },
        //删除项
        delFun(item) {
            this.$emit("del", item);
        },
    },
};
</script>

<style lang="less" scoped>
.ant-dropdown {
    .ant-dropdown-menu {
       

        .ant-dropdown-menu-item {
            display: flex;
            align-items: center;

            span:nth-child(1) {
                margin-right: .625rem;
            }
        }
    }
}
</style>